var express=require('express');
var router=express.Router();
const {getAdmins,getAdminsById, updateAdmins, deleteAdmins, addAdmins, searchPersonal}=require('../service/adminsServeice');

router.get('/getAdmins',async function(req,res,next){
  const personal =await getAdmins(req.query);
  console.log('one',req.query);
  res.send(personal)
});

router.post('/getAdminsById',async function(req,res,next){
  const data= await getAdminsById(req.body);
  res.send(data)
})
router.post('/updateAdmins',async function(req,res,next){
  const data =await updateAdmins(req.body);
  res.send(data)
})
router.post('/deleteAdmins',async function(req,res,next){
  const data=await deleteAdmins(req.body);
  res.send(data)
})
router.post('/addAdmins',async function(req,res,next){
  const data =await addAdmins(req.body);
  res.send(data)
})
module.exports = router;